from turtle import *
from PIL import Image, ImageDraw, ImageFont
import random,time

name = ['','花样滑冰','冰壶','速度滑雪','有舵雪橇']
for i in range(1,5):
    img = Image.open('素材包/%d.png'%i).resize((1000,550))
    draw = ImageDraw.Draw(img)
    font = ImageFont.truetype('simhei.ttf', 60)
    draw.text((600, 450), name[i], fill='red', font=font)
    #img.show()
    img.save('展示图片/%d.png'%i)
index = 1
setup(1000,550)
bgpic('展示图片/1.png')
def left():
    global index
    index += 1
    if index > 4:
        index = 1
    bgpic('展示图片/%d.png'%index)
def right():
    global index
    index -= 1
    if index<1:
        index = 4
    bgpic('展示图片/%d.png' % index)

onkey(left, "Left")
onkey(right, "Right")
listen()
done()
